package cn.dancepeak.system.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Menu {
    private Long id;//主键
    private String name;//菜单名字
    private String component;//vue组件路径
    private String url;//菜单路由地址
    private String icon;//菜单图标
    private Integer index;//菜单排序
    private Long parentId;//上级菜单id

    private String parentName;//上级菜单对象

    //如果数组为空前端不接收
    @JsonInclude(value = JsonInclude.Include.NON_EMPTY)
    private List<Menu> children = new ArrayList<>();
}
